<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link type="text/css" rel="stylesheet" href="<%=basePath %>statics/css/common/common-1.0.css">
<link type="text/css" rel="stylesheet" href="<%=basePath %>statics/js/plug/jqueryUI/jquery-ui.css">
<link rel="stylesheet" type="text/css" href="<%=basePath%>statics/js/plug/ztree/css/zTreeStyle/zTreeStyle.css">
<link type="text/css" rel="stylesheet" href="<%=basePath%>statics/js/plug/jbox/jBox.css"/>
<link rel="stylesheet" type="text/css" href="<%=basePath %>statics/css/base/basemenu/menu.css">

<script type="text/javascript" src="<%=basePath %>statics/js/plug/jquery-1.12.0.min.js"></script>
<script type="text/javascript" src="<%=basePath %>statics/js/plug/jqueryUI/jquery-ui.js"></script>
<script type="text/javascript" src="<%=basePath%>statics/js/plug/ztree/js/jquery.ztree.all-3.5.js"></script>
<!-- jquery 验证-->
<script type="text/javascript" src="<%=basePath %>statics/js/plug/jquery.validate.js"></script>
<script type="text/javascript" src="<%=basePath %>statics/js/plug/jbox/jBox.js"></script>
<%-- <script type="text/javascript" src="<%=basePath %>statics/js/common/common.js"></script> --%>
<script type="text/javascript" src="<%=basePath%>statics/js/common/common-1.0.js"></script>
<script type="text/javascript" src="<%=basePath %>statics/js/base/basemenu/menu_manage.js"></script>
<title>菜单管理</title>
</head>
<body>
	<shiro:hasPermission name="BaseMenu:view">
	 <div class="nav" style="width:260px;float: left;">
		<div class="table_search_div_tree">
	        &nbsp;关键字：<input id="searchName" type="text"/>&nbsp;
	         <button onclick="search_ztree('menuTree','searchName')">查询</button>
	    </div>
		<div id="treeDiv" style="overflow-y:auto;overflow-x:hidden;">
	        <ul id="menuTree" class="ztree"></ul>
	    </div>	      
	</div>
	<div class="table_title_div" style="float: left;margin-top: 7px;">
        <table cellpadding="0" cellspacing="0">
          <tr>
            <td align="left"><span id="title"></span></td>
          	<td align="right" valign="middle">
          	   <ul>
		            <shiro:hasPermission name="BaseMenu:create">
		                <li><button id="addBtn" onclick="add();">添加</button></li>
		            </shiro:hasPermission>
		            <shiro:hasPermission name="BaseMenu:delete">
		                <li><button id="deleteBtn" onclick="deleteMenu();">删除</button></li>
		            </shiro:hasPermission>
		        </ul>
          	</td>
          </tr>
        </table>
 	 </div>
	</shiro:hasPermission>
	
	<div id="addDialog" style="float: left;display: none;" class="table_edit_div">
       <shiro:hasPermission name="BaseMenu:create">
            <form id="addForm">
                <table style="width: 100%;" border="0">
               			<tr style="display:block;">
	                        <td class="attr"><span>菜单名称：</span></td>
	                        <td ><input id="label" type="text" name="label" >
	                        <img alt="" src="<%=basePath %>statics/images/common/star.gif" width="9" height="10">
	                        </td>
                   		</tr>
	                    <tr style="display: block;">
	                        <td class="attr"><span>所属父类：</span></td>
	                        <td >
	                        	<input type="text" id="menuParentName" name="menuParentName" value="无" readonly="readonly" />
	                        	<input type="hidden" id="parentId" name="parentId" value="0" />
	                        	<img alt="" src="<%=basePath %>statics/images/common/star.gif" width="9" height="10">
	                        </td>
	                    </tr>
	                    <tr style="display: block;">
	                        <td class="attr"><span>菜单样式：</span></td>
	                        <td ><input id="className" type="text" name="className" >
	                        <img alt="" src="<%=basePath %>statics/images/common/star.gif" width="9" height="10">
	                        </td>
	                    </tr>
	                    <tr id="urlTr" style="display: block;">
	                        <td class="attr"><span>菜单链接：</span></td>
	                        <td ><input id="url" type="text" name="url" ></td>
	                    </tr>
	                    <tr style="display:block;">
	                        <td class="attr"><span>菜单高度：</span></td>
	                        <td ><input id="controlHeight" type="text" name="controlHeight" >
	                        <img alt="" src="<%=basePath %>statics/images/common/star.gif" width="9" height="10">
	                        </td>
	                    </tr>
	                    <tr style="display:block;">
	                        <td class="attr"><span>菜单序号：</span></td>
	                        <td ><input id="sortFlag" type="text" name="sortFlag" >
	                        <img alt="" src="<%=basePath %>statics/images/common/star.gif" width="9" height="10">
	                        </td>
	                    </tr>
	                    <tr style="display: block;">
	                        <td class="attr"><span>查看权限：</span></td>
	                        <td >
	                        	<input type="text" id="menuLookAuthority" name="menuLookAuthority"/>
	                        	<input id="authorityId" name="authorityId" type="hidden"/>
	                        	<img alt="" src="<%=basePath %>statics/images/common/star.gif" width="9" height="10">
	                        </td>
	                    </tr>
	                    <tr style="display: block;">
	                        <td class="attr"><span>操作权限：</span></td>
	                        <td >
	                        	<input type="text" id="authority" name="authority"/>
	                        	<input id="operateAuthorityId" name="operateAuthorityId" type="hidden"/>
	                        	<img alt="" src="<%=basePath %>statics/images/common/star.gif" width="9" height="10">
	                        </td>
	                    </tr>
	                     <tr style="height:100px; display:block;">
	                        <td class="attr"><span>备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注：</span></td>
	                        <td height="100px" ><textarea id="remark" name="remark" cols="35" rows="5" style="width: 292px;height: 100px;"></textarea></td>
	                    </tr>
	                    <tr style="height: 50px;">
	                        <td style="text-align: center;" colspan="2"><button id="saveBtn" onclick="save();">保存</button></td>
	                    </tr>
                </table>
            </form>
          </shiro:hasPermission>
       </div>
	<!-- 菜单分类 -->  
	<div id="parentMenu" class="menuContent" style="width: 290px; overflow-y: auto;">
		<ul id="parentMenuTree" class="ztree"></ul>
	</div>
	<%--添加菜单（查看权限树）--%>
	<div id="menuLookAuthorityDiv" class="menuContent" style="width: 290px; overflow-y: auto;">
		<ul id="menuLookAuthorityTree" class="ztree"></ul>
	</div>
	<%--编辑菜单（查看权限树） --%>
	<div id="menuLookAuthorityEditDiv" class="menuContent" style="width: 290px; overflow-y: auto;">
		<ul id="menuLookAuthorityEditTree" class="ztree"></ul>
	</div>
	<!-- 菜单操作权限 -->
	<div id="menuAuthority" class="menuContent" style="width: 290px; overflow: auto;">
		<ul id="MenuAuthorityTree" class="ztree"></ul>
	</div>
	
	<div id="editDialog" style="float: left;display: none;" class="table_edit_div">
       <shiro:hasPermission name="BaseMenu:update">
            <form id="updateForm">
                <table style="width: 100%;" border="0">
               			<tr style="display:block;">
	                        <td class="attr"><span>菜单名称：</span></td>
	                        <td ><input id="labelEdit" type="text" name="label"/>
	                        <img alt="" src="<%=basePath %>statics/images/common/star.gif" width="9" height="10">
	                        </td>
                   		</tr>
	                    <tr style="display: block;">
	                        <td class="attr"><span>所属父类：</span></td>
	                        <td >
	                        	<input type="text" id="menuParentNameEdit" name="menuParentName" value="无" readonly/>
	                        	<input type="hidden" id="parentIdEdit" name="parentId" value="0" />
	                        	<img alt="" src="<%=basePath %>statics/images/common/star.gif" width="9" height="10">
	                        </td>
	                    </tr>
	                    <tr style="display: block;">
	                        <td class="attr"><span>菜单样式：</span></td>
	                        <td ><input id="classNameEdit" type="text" name="className" >
	                        <img alt="" src="<%=basePath %>statics/images/common/star.gif" width="9" height="10">
	                        </td>
	                    </tr>
	                    <tr id="urlEditTr" style="display:block;">
	                        <td class="attr"><span>菜单链接：</span></td>
	                        <td >
	                        	<input id="urlEdit" type="text" name="url" >
	                        	<input id="urlEditReserve" type="hidden" name="urlEditReserve" />
	                        </td>
	                    </tr>
	                    <tr style="display:block;">
	                        <td class="attr"><span>菜单高度：</span></td>
	                        <td ><input id="controlHeightEdit" type="text" name="controlHeight" >
	                        <img alt="" src="<%=basePath %>statics/images/common/star.gif" width="9" height="10">
	                        </td>
	                    </tr>
	                    <tr style="display:block;">
	                        <td class="attr"><span>菜单序号：</span></td>
	                        <td ><input id="sortFlagEdit" type="text" name="sortFlag" >
	                        <img alt="" src="<%=basePath %>statics/images/common/star.gif" width="9" height="10">
	                        </td>
	                    </tr>
	                    <tr style=" display: block;">
	                    	<td class="attr"><span>查看权限：</span></td>
	                    	<td>
	                    		<input type="text" id="menuLookAuthorityEdit" name="menuLookAuthorityEdit" readonly/>
	                        	<input type="hidden" id="menuLookAuthorityIdEdit" name="authorityId"/>
	                        	<img alt="" src="<%=basePath %>statics/images/common/star.gif" width="9" height="10">
	                    	</td>
	                    </tr>
	                    <tr style="display: block;">
	                        <td class="attr"><span>操作权限：</span></td>
	                        <td >
	                        	<input type="text" id="authorityEdit" name="authority" readonly/>
	                        	<input type="hidden" id="operateAuthorityIdEdit" name="operateAuthorityId"/>
	                        	<input type="hidden" id="operateAuthorityIdEditCopy" name="operateAuthorityIdEditCopy"/>
	                        	<img alt="" src="<%=basePath %>statics/images/common/star.gif" width="9" height="10">
	                        </td>
	                    </tr>
	                     <tr style=" height:100px; display:block;">
	                        <td class="attr"><span>备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注：</span></td>
	                        <td height="100px" ><textarea id="remarkEdit" name="remark" cols="35" rows="5" style="width: 292px;height: 100px;"></textarea></td>
	                    </tr>
	                    <tr style="height: 50px;">
	                        <td style="text-align: center;" colspan="2"><button id="saveEditBtn" onclick="saveEdit();">保存</button></td>
	                    </tr>
                </table>
            </form>
          </shiro:hasPermission>	
       </div>
       	<div id="parentEditMenu" class="menuContent" style="width: 290px; overflow-y: auto;">
			<ul id="parentEditMenuTree" class="ztree"></ul>
		</div>
		<div id="menuEditAuthority" class="menuContent" style="width: 290px; overflow-y: auto;">
			<ul id="MenuEditAuthorityTree" class="ztree"></ul>
		</div>
</body>
</html>